package com.atguigu.eduservice.client;

import com.atguigu.commonutils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 34633
 */

/**
 * 出错后执行 fallback类中方法，VodFileDegradeFeignClient类实现了VodClient
 */
@FeignClient(value = "service-vod",fallback = VodFileDegradeFeignClient.class)
@Component
public interface VodClient {
    /**
     * 定义要调用方法路径
     * @PathVariable("id") 必须要指定名称，否则会出问题
     * @param id
     * @return
     */
    @DeleteMapping("/eduvod/video/removeAlyVideo/{id}")
    R removeAlyVideo(@PathVariable("id") String id);

    /**
     * 调用vod服务删除多个阿里云视频
     * @param videoIdList
     * @return
     */
    @DeleteMapping("/eduvod/video/delete-batch")
    public R deleteBatch(@RequestParam("videoIdList") List<String> videoIdList);




}
